package com.simplegovern.setting.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.simplegovern.setting.Setting;
import com.simplegovern.setting.dao.SettingDAO;

public class SettingService {
	@Autowired
	private SettingDAO settingDAO;
	
	public List<Setting> getSettingList(Long groupId){
		return settingDAO.getSettingList(groupId);
	}
	
	public Setting getSettingByID(Long id){
		return settingDAO.findById(id);
	}
	
	@Transactional(propagation = Propagation.REQUIRED)
	public void updateSetting(Setting setting){
		settingDAO.update(setting);
	}
}
